<?php

class UnionApi extends ApiBase
{
	private $mysql = null;

	public function __construct()
	{
		parent::__construct();
		$this->mysql = n_api('mysql')->cname('weixin');
	}

	public function checkWxidExists($wxid)
	{
		$query = "select * from union_main where wxid = '$wxid' and isdel = 'N'";
		$rs = $this->mysql->fetchFirst($query);

		if (count($rs) > 0)
			return true;
		else 
			return false;
	}

	public function getUnionInfoByPpid($ppid)
	{
		$query = "select * from union_main where ppid = $ppid and isdel = 'N'";
		$rs = $this->mysql->select($query);
		return $rs;
	}


}